<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<jsp:include page="../include/header.jsp" />
<script type="text/javaScript">
<!--
	function viewPage(id) {
		$('#scs_sys_key').val(id);
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentSystemRecordForm.do"/>');
		$('#listForm').submit();		
	}

	function writeFormPage() {
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentSystemWriteForm.do"/>');
		$('#listForm').submit();
	}
	
	function excelFormPage() {
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentSystemExcelForm.do"/>');
		$('#listForm').submit();
	}
	
	function updateFormPage(id) {
		$('#scs_sys_key').val(id);
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentSystemWriteForm.do"/>');
		$('#listForm').submit();
	}

	/* pagination 페이지 링크 function */
	function paging(pageNo){
		$('#pageIndex').val(pageNo);
		$('#listForm').attr('action', '<c:url value="/currentSystem/currentSystemList.do"/>');
		$('#listForm').submit();
	}

-->
</script>
<!-- contents s -->
<div class="container" id="container">
	<span class="round lt">&nbsp;</span>
    <span class="round rt">&nbsp;</span>
    <span class="round lb">&nbsp;</span>
    <span class="round rb">&nbsp;</span>
    <div class="container_area">
    <form name="listForm" id="listForm" method="post" action="<c:url value='/currentSystem/currentSystemList.do'/>">
		<input type="hidden" name="pageIndex" id="pageIndex" value="${currentSystemVO.pageIndex }"/>
		<input type="hidden" name="scs_sys_key" id="scs_sys_key" />
		<input type="hidden" name="scs_area_key" id="scs_area_key" value="${currentSystemVO.scs_area_key }"/>
	</form>
        <h2 class="tit_h2">시설현황 목록</h2>
        <jsp:include page="../include/navi.jsp" />
        <div class="table_wrap">
        	<table summary="시설현황 목록" class="table_list">
            	<caption>시설현황 목록</caption>
                <colgroup>
                	<col width="15%" /> <!-- D : col width로 테이블 넓이 조절 -->
                    <col width="10%" />
                    <col width="30%" />
                    <col width="15%" />
                    <col width="15%" />
                    <col width="15%" />
                </colgroup>
                <thead>
                	<tr>
                        <th scope="col">품명</th>
                        <th scope="col">타입</th>
                        <th scope="col">장비사양</th>
                        <th scope="col">제조사</th>
                        <th scope="col">시공사</th>
                       	<th scope="col">이력사항</th>
                    </tr>
                </thead>
                <tbody>
                <c:if test="${not empty resultList}">
	                <c:forEach var="result" items="${resultList}" varStatus="status">
					<tr>
						<td><a href="<c:url value="/currentSystem/currentSystemWriteForm.do"/>" onclick="updateFormPage('${result.scs_sys_key}'); return false;"><c:out value="${result.scs_sys_name}"/></a>&nbsp;</td>
						<td>${result.scs_sys_type}</td>
						<td>${result.scs_sys_spec}</td>
						<td>${result.scs_hstry_maker}</td>
						<td>${result.scs_hstry_huilder}</td>
						<td><a href="<c:url value="/currentSystem/currentSystemRecordForm.do"/>" onclick="viewPage('${result.scs_sys_key}'); return false;" class="btn_tb">이력 관리</a></td>
					</tr>
					</c:forEach>
				</c:if>
				<c:if test="${empty resultList}">
					<tr><td colspan="6">데이터가 없습니다.</td></tr>
				</c:if>
                </tbody>
            </table>
        </div>
		<div class="btn_bbs">
			<a href="<c:url value="/currentSystem/currentSystemExcelForm.do"/>" onclick="excelFormPage(); return false;" class="btn_write">배치 등록</a>
			<a href="<c:url value="/currentSystem/currentSystemWriteForm.do"/>" onclick="writeFormPage(); return false;" class="btn_write">설비 등록</a>
			<c:if test="${loginSessionInfo.admin }">
				<a href="<c:url value="/currentSystem/currentServiceareaList.do"/>" class="btn_write">리스트</a>
			</c:if>
		</div>
    </div>
</div>
	<!-- contents e -->
<jsp:include page="../include/footer.jsp" />